﻿using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class EGUIPreviewWindow : EditorWindow
{
    public static EGUIPreviewWindow instance;
    private Vector2 scroPos;
    private List<string> resList;

    public static void Show(List<string> resList)
    {
        if (instance == null)
        {
            instance = GetWindow<EGUIPreviewWindow>();
        }

        instance.resList = resList;
    }

    private void OnGUI()
    {
        scroPos = GUILayout.BeginScrollView(scroPos, GUILayout.Width(position.width),
            GUILayout.Height(position.height));
        string str = "";
        foreach (var s in resList)
        {
            str += s + "\n\n\n";
        }

        GUILayout.TextArea(str);
        
        GUILayout.EndScrollView();
    }
}